package com.zjyd.douyangcommoncore.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.zjyd.douyangcommoncore.annotation.DouYangAutoTable;
import lombok.Data;
import org.dromara.autotable.annotation.ColumnComment;
import org.dromara.autotable.annotation.ColumnDefault;
import org.dromara.autotable.annotation.ColumnType;
import org.dromara.autotable.annotation.mysql.MysqlTypeConstant;
import org.dromara.mpe.autotable.annotation.Column;
import org.dromara.mpe.autotable.annotation.ColumnId;
import org.dromara.mpe.autotable.annotation.Table;

/**
 * 用户实体
 */
@Data
@Table(value = "dy_users", comment = "用户表")
@DouYangAutoTable(tableName = "dy_users", generateService = true)
public class UserPo {

    @ColumnComment("id")
    @ColumnId(mode = IdType.AUTO, comment = "id主键", type = MysqlTypeConstant.BIGINT, length = 32)
    private Integer id;

    // 指定字段长度
    @ColumnType(length = 20)
    // 指定字段注释
    @ColumnComment("用户名")
    private String username;

    @ColumnType(length = 120)
    @ColumnComment("密码")
    private String password;

    // 盐值
    @ColumnType(length = 120)
    @ColumnComment("盐值")
    private String salt;

    @ColumnDefault("0")
    @ColumnComment("年龄")
    private Integer age;

    @ColumnType(length = 20)
    // 设置注释、默认值、不为空
    @Column(comment = "电话", defaultValue = "0000", notNull = true)
    private String phone;

    //邮箱
    @ColumnType(length = 20)
    @ColumnComment("邮箱")
    private String email;
}
